﻿using SystemModule;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace M2Server
{
    public partial class TBaseObject
    {
        /// <summary>
        /// 唯一ID
        /// </summary>
        public int m_ActorsId;
        /// <summary>
        /// 游戏对象类型
        /// </summary>
        public TObjType m_ObjType;
        /// <summary>
        /// 地图名称
        /// </summary>
        public string m_sMapName;
        /// <summary>
        /// 人物名称
        /// </summary>
        public string m_sCharName;
        /// <summary>
        /// 物所在座标X(4字节)
        /// </summary>
        public int m_nCurrX = 0;
        /// <summary>
        /// 人物所在座标Y(4字节)
        /// </summary>
        public int m_nCurrY = 0;
        /// <summary>
        /// 人物所在方向(1字节)
        /// </summary>
        public byte m_btDirection = 0;
        /// <summary>
        /// 人物的性别(1字节)
        /// 0 男 1女
        /// </summary>
        public byte m_btGender = 0;
        /// <summary>
        /// 人物的头发(1字节)
        /// </summary>
        public byte m_btHair = 0;
        /// <summary>
        /// 人物的职业 0-战 1-法 2-道
        /// </summary>
        public byte m_btJob = 0;
        /// <summary>
        /// 人物金币数
        /// </summary>
        public int m_nGold = 0;
        /// <summary>
        /// 对象基本属性
        /// </summary>
        public TAbility m_Abil;
        /// <summary>
        /// 对象状态
        /// </summary>
        public int m_nCharStatus = 0;
        /// <summary>
        /// 回城地图
        /// </summary>
        public string m_sHomeMap;
        /// <summary>
        /// 回城座标X
        /// </summary>
        public int m_nHomeX = 0;
        /// <summary>
        /// 回城座标Y
        /// </summary>
        public int m_nHomeY = 0;
        /// <summary>
        /// 是否骑马
        /// </summary>
        public bool m_boOnHorse = false;
        /// <summary>
        /// 马的类型
        /// </summary>
        public byte m_btHorseType = 0;
        /// <summary>
        /// 着装效果
        /// </summary>
        public byte m_btDressEffType = 0;
        public uint m_BatterUseTick = 0;
        /// <summary>
        /// 人物的PK值
        /// </summary>
        public int m_nPkPoint = 0;
        public byte btB2 = 0;
        public TBatterZhuiXinMessage m_nBatterZhuiXin;
        /// <summary>
        /// 增加健康值
        /// </summary>
        public int m_nIncHealth = 0;
        /// <summary>
        /// 增加攻击值
        /// </summary>
        public int m_nIncSpell = 0;
        /// <summary>
        /// 增加治愈值
        /// </summary>
        public int m_nIncHealing = 0;
        /// <summary>
        /// 在行会战争地图中死亡次数
        /// </summary>
        public int m_nFightZoneDieCount = 0;
        /// <summary>
        /// 人物永久属性
        /// </summary>
        public TNakedAbility m_BonusAbil;
        /// <summary>
        /// 奖金点
        /// </summary>
        public int m_nBonusPoint = 0;
        /// <summary>
        /// 幸运度
        /// </summary>
        public double m_dBodyLuck = 0;
        /// <summary>
        /// 幸运度等级
        /// </summary>
        public int m_nBodyLuckLevel = 0;
        /// <summary>
        /// 脚本变量
        /// </summary>
        public byte[] m_QuestFlag = new byte[128];
        public int m_nCharStatusEx = 0;
        /// <summary>
        /// 怪物经验值
        /// </summary>
        public int m_dwFightExp = 0;
        /// <summary>
        /// 角色属性
        /// </summary>
        public TAbility m_WAbil;
        /// <summary>
        /// 增加的属性
        /// </summary>
        public TAddAbility m_AddAbil;
        /// <summary>
        /// 可视范围大小
        /// </summary>
        public int m_nViewRange = 0;
        /// <summary>
        /// 人物状态属性值，一般是持续多少秒
        /// </summary>
        public ushort[] m_wStatusTimeArr = new ushort[12];
        /// <summary>
        /// 人物状态持续的开始时间
        /// </summary>
        public uint[] m_dwStatusArrTick = new uint[12];
        /// <summary>
        /// 攻击力增加  2-无极真气 4-酒气护体
        /// </summary>
        public ushort[] m_wStatusArrValue = new ushort[12];
        /// <summary>
        /// 多少秒  2-无极真气时长  4-酒气护体间隔
        /// </summary>
        public uint[] m_dwStatusArrTimeOutTick = new uint[12];
        /// <summary>
        /// 形像代码
        /// </summary>
        public ushort m_wAppr = 0;
        /// <summary>
        /// 角色类型
        /// </summary>
        public byte m_btRaceServer = 0;
        /// <summary>
        /// 角色外形
        /// </summary>
        public byte m_btRaceImg = 0;
        /// <summary>
        /// 人物攻击准确度
        /// </summary>
        public byte m_btHitPoint = 0;
        /// <summary>
        /// 另加攻击伤害(攻杀)
        /// </summary>
        public sbyte m_nHitPlus = 0;
        /// <summary>
        /// 双倍攻击伤害
        /// </summary>
        public sbyte m_nHitDouble = 0;
        /// <summary>
        /// 记忆使用间隔
        /// </summary>
        public uint m_dwGroupRcallTick = 0;
        /// <summary>
        /// 记忆全套
        /// </summary>
        public bool m_boRecallSuite = false;
        public bool bo245 = false;
        /// <summary>
        /// 体力恢复
        /// </summary>
        public sbyte m_nHealthRecover = 0;
        /// <summary>
        /// 魔法恢复
        /// </summary>
        public sbyte m_nSpellRecover = 0;
        /// <summary>
        /// 中毒躲避
        /// </summary>
        public byte m_btAntiPoison = 0;
        /// <summary>
        /// 中毒恢复
        /// </summary>
        public sbyte m_nPoisonRecover = 0;
        /// <summary>
        /// 魔法躲避
        /// </summary>
        public sbyte m_nAntiMagic = 0;
        /// <summary>
        /// 人物的幸运值Luck (爆率机率)
        /// </summary>
        public int m_nLuck = 0;
        /// <summary>
        /// 每次增加血的点数
        /// </summary>
        public int m_nPerHealth = 0;
        /// <summary>
        /// 每次增加血的点数(道士的自愈术)
        /// </summary>
        public int m_nPerHealing = 0;
        /// <summary>
        /// 每次增加的魔法点数
        /// </summary>
        public int m_nPerSpell = 0;
        /// <summary>
        /// 增加攻击的间隔
        /// </summary>
        public uint m_dwIncHealthSpellTick = 0;
        /// <summary>
        /// 中绿毒降HP点数
        /// </summary>
        public byte m_btGreenPoisoningPoint = 0;
        /// <summary>
        /// 人物身上最多可带金币数
        /// </summary>
        public int m_nGoldMax = 0;
        /// <summary>
        /// 人物敏捷度
        /// </summary>
        public byte m_btSpeedPoint = 0;
        /// <summary>
        /// 人物权限等级
        /// </summary>
        public byte m_btPermission = 0;
        /// <summary>
        /// 攻击速度
        /// </summary>
        public sbyte m_nHitSpeed = 0;
        /// <summary>
        /// 不死系,1-为不死系
        /// </summary>
        public byte m_btLifeAttrib = 0;
        /// <summary>
        /// 否可以看到隐身人物(视线范围)
        /// </summary>
        public ushort m_btCoolEye = 0;
        /// <summary>
        /// 是否被召唤(主人)
        /// </summary>
        public TBaseObject m_Master = null;
        /// <summary>
        /// 怪物叛变时间
        /// </summary>
        public uint m_dwMasterRoyaltyTick = 0;
        /// <summary>
        /// 怪物叛变计时
        /// </summary>
        public uint m_dwMasterRoyaltyTime = 0;
        public uint m_dwMasterTick = 0;
        /// <summary>
        /// 宝宝杀怪计数,用于宝宝升级用
        /// </summary>
        public int n294 = 0;
        /// <summary>
        /// 宝宝等级 1-7
        /// </summary>
        public byte m_btSlaveExpLevel = 0;
        /// <summary>
        /// 召唤等级
        /// </summary>
        public byte m_btSlaveMakeLevel = 0;
        /// <summary>
        /// 下属列表
        /// </summary>
        public List<TBaseObject> m_SlaveList = null;
        /// <summary>
        /// 宝宝攻击状态(休息/攻击)
        /// </summary>
        public bool m_boSlaveRelax = false;
        /// <summary>
        /// 下属攻击状态
        /// </summary>
        public byte m_btAttatckMode = 0;
        /// <summary>
        /// 名字的颜色
        /// </summary>
        public byte m_btNameColor = 0;
        /// <summary>
        /// 亮度
        /// </summary>
        public int m_nLight = 0;
        /// <summary>
        /// 行会占争范围
        /// </summary>
        public bool m_boGuildWarArea = false;
        /// <summary>
        /// 所属城堡
        /// </summary>
        public TUserCastle m_Castle = null;
        // 城堡成员
        public bool bo2B0 = false;
        public uint m_dw2B4Tick = 0;
        /// <summary>
        /// 无敌模式
        /// </summary>
        public bool m_boSuperMan = false;
        public bool bo2B9 = false;
        /// <summary>
        /// 不进入火墙
        /// </summary>
        public bool bo2BA = false;
        /// <summary>
        /// 是否是动物
        /// </summary>
        public bool m_boAnimal = false;
        /// <summary>
        /// 人物死亡是否不掉物品
        /// </summary>
        public bool m_boNoItem = false;
        /// <summary>
        /// 隐身模式
        /// </summary>
        public bool m_boFixedHideMode = false;
        /// <summary>
        /// 不能冲撞模式(即敌人不能使用野蛮冲撞技能攻击)
        /// </summary>
        public bool m_boStickMode = false;
        // 被打到是否减慢行走速度,等级小于50的怪 F-减慢 T-不减慢
        public bool bo2BF = false;
        /// <summary>
        /// 非攻击模式
        /// </summary>
        public bool m_boNoAttackMode = false;
        public bool bo2C1 = false;
        /// <summary>
        /// 正在被挖尸体
        /// </summary>
        public bool m_boButchSkeleton = false;
        /// <summary>
        /// 尸体
        /// </summary>
        public bool m_boSkeleton = false;
        /// <summary>
        /// 挖肉，肉的品质
        /// </summary>
        public int m_nMeatQuality = 0;
        /// <summary>
        /// 身体坚韧性
        /// </summary>
        public int m_nBodyLeathery = 0;
        /// <summary>
        /// 不能走动模式
        /// </summary>
        public bool m_boHolySeize = false;
        /// <summary>
        /// 不能走动间隔
        /// </summary>
        public uint m_dwHolySeizeTick = 0;
        /// <summary>
        /// 不能走动时长
        /// </summary>
        public uint m_dwHolySeizeInterval = 0;
        /// <summary>
        /// 狂化模式(红名)
        /// </summary>
        public bool m_boCrazyMode = false;
        /// <summary>
        /// 狂化模式间隔
        /// </summary>
        public uint m_dwCrazyModeTick = 0;
        /// <summary>
        /// 狂化模式时长
        /// </summary>
        public uint m_dwCrazyModeInterval = 0;
        /// <summary>
        /// 心灵启示
        /// </summary>
        public bool m_boShowHP = false;
        /// <summary>
        /// 心灵启示检查时间
        /// </summary>
        public uint m_dwShowHPTick = 0;
        /// <summary>
        /// 心灵启示有效时长
        /// </summary>
        public uint m_dwShowHPInterval = 0;
        public bool bo2F0 = false;
        public uint m_dwDupObjTick = 0;
        /// <summary>
        /// 所在地图场景
        /// </summary>
        public Envirnoment m_PEnvir = null;
        /// <summary>
        /// 尸体是否清除
        /// </summary>
        public bool m_boGhost = false;
        /// <summary>
        /// 尸体清除间隔
        /// </summary>
        public uint m_dwGhostTick = 0;
        /// <summary>
        /// 对象是否死亡
        /// </summary>
        public bool m_boDeath = false;
        /// <summary>
        /// 死亡间隔
        /// </summary>
        public uint m_dwDeathTick = 0;
        /// <summary>
        /// 怪物所拿的武器
        /// </summary>
        public byte m_btMonsterWeapon = 0;
        // 弯腰间隔
        public uint m_dwStruckTick = 0;
        /// <summary>
        /// 刷新消息
        /// </summary>
        public bool m_boWantRefMsg = false;
        /// <summary>
        /// 增加到地图是否成功
        /// </summary>
        public bool m_boAddtoMapSuccess = false;
        // 0x316
        public bool m_bo316 = false;
        /// <summary>
        /// 我的行会
        /// </summary>
        public TGUild m_MyGuild = null;
        /// <summary>
        /// 行会排名
        /// </summary>
        public int m_nGuildRankNo = 0;
        /// <summary>
        /// 行会封号
        /// </summary>
        public string m_sGuildRankName = string.Empty;
        // 攻杀相关
        public byte m_btAttackSkillCount = 0;
        // 攻杀计数
        public byte m_btAttackSkillPointCount = 0;
        /// <summary>
        /// 怪物向集中点集中
        /// </summary>
        public bool m_boMission = false;
        /// <summary>
        /// 集中点坐标X
        /// </summary>
        public int m_nMissionX = 0;
        /// <summary>
        /// 集中点坐标Y
        /// </summary>
        public int m_nMissionY = 0;
        /// <summary>
        /// 隐身模式（隐身戒指）
        /// </summary>
        public bool m_boHideMode = false;
        /// <summary>
        /// 石像化
        /// </summary>
        public bool m_boStoneMode = false;
        /// <summary>
        /// 是否可以看到隐身人物(视线范围)
        /// </summary>
        public bool m_boCoolEye = false;
        // 是否用了神水
        public bool m_boUserUnLockDurg = false;
        // 魔法隐身了
        public bool m_boTransparent = false;
        // 管理模式
        public bool m_boAdminMode = false;
        // 隐身模式
        public bool m_boObMode = false;
        // 传送戒指
        public bool m_boTeleport = false;
        // 麻痹戒指
        public bool m_boParalysis = false;
        // 防麻痹
        public bool m_boUnParalysis = false;
        // 复活戒指
        public bool m_boRevival = false;
        // 防复活
        public bool m_boUnRevival = false;
        // 复活戒指使用间隔计数
        public uint m_dwRevivalTick = 0;
        // 火焰戒指
        public bool m_boFlameRing = false;
        // 倚天劈地技能   倚天剑
        public bool m_boYTPDRing = false;
        // 血魄一击
        public bool m_boXPYJRing = false;
        // 流星 技能     流星火雨戒指
        public bool m_boMeteorRing = false;
        // 治愈戒指
        public bool m_boRecoveryRing = false;
        // 未知戒指
        public bool m_boAngryRing = false;
        // 护身戒指
        public bool m_boMagicShield = false;
        // 防护身
        public bool m_boUnMagicShield = false;
        // 活力戒指
        public bool m_boMuscleRing = false;
        // 技巧项链
        public bool m_boFastTrain = false;
        // 探测项链
        public bool m_boProbeNecklace = false;
        // 行会传送
        public bool m_boGuildMove = false;
        // 无敌(未完全)物品
        public bool m_boSupermanItem = false;
        // 触发祈祷
        public bool m_bopirit = false;
        // 掉物品
        public bool m_boNoDropItem = false;
        // 死亡是不是掉装备
        public bool m_boNoDropUseItem = false;
        // 经验物品
        public bool m_boExpItem = false;
        // 经验物品值
        public double m_rExpItem = 0;
        // 力量物品(影响力量的物品)
        public bool m_boPowerItem = false;
        // 力量物品值
        public double m_rPowerItem = 0;
        // PK 死亡掉经验，不够经验就掉等级
        public int m_dwPKDieLostExp = 0;
        // PK 死亡掉等级
        public int m_nPKDieLostLevel = 0;
        // 心灵启示
        public bool m_boAbilSeeHealGauge = false;
        // 是否使用魔法盾
        public bool m_boAbilMagBubbleDefence = false;
        // 魔法盾等级
        public byte m_btMagBubbleDefenceLevel = 0;
        // 是否使用护体神盾
        public bool m_boProtectionDefence = false;
        // 护体神盾等级 
        public byte m_boProtectionDefenceLevel = 0;
        // 使用护体神盾的结束时间 
        public uint m_boProtectionTick = 0;
        // 移行换位使用间隔 
        public uint m_boMagChangXYTick = 0;
        /// <summary>
        /// 搜索目标时间
        /// </summary>
        public uint m_dwSearchTime = 0;
        /// <summary>
        /// 搜索间隔
        /// </summary>
        public uint m_dwSearchTick = 0;
        /// <summary>
        /// 运行间隔
        /// </summary>
        public uint m_dwRunTick = 0;
        /// <summary>
        /// 运行时间
        /// </summary>
        public int m_nRunTime = 0;
        /// <summary>
        /// 特别指定为 加血间隔
        /// </summary>
        public int m_nHealthTick = 0;
        /// <summary>
        /// 加魔间隔
        /// </summary>
        public int m_nSpellTick = 0;
        /// <summary>
        /// 目标(攻击或加血,等对像)
        /// </summary>
        public TBaseObject m_TargetCret = null;
        // 0x37C
        public uint m_dwTargetFocusTick = 0;
        /// <summary>
        /// 人物被对方杀害时对方指针
        /// </summary>
        public TBaseObject m_LastHiter = null;
        public uint m_LastHiterTick = 0;
        /// <summary>
        /// 敌人伤害时对方指针
        /// </summary>
        public TBaseObject m_ExpHitter = null;
        public uint m_ExpHitterTick = 0;
        /// <summary>
        /// 传送戒指使用间隔
        /// </summary>
        public uint m_dwTeleportTick = 0;
        /// <summary>
        /// 探测项链使用间隔
        /// </summary>
        public uint m_dwProbeTick = 0;
        /// <summary>
        /// 地图传送使用间隔
        /// </summary>
        public uint m_dwMapMoveTick = 0;
        /// <summary>
        /// 人物攻击变色标志(灰色)
        /// </summary>
        public bool m_boPKFlag = false;
        // 人物攻击变色时间长度(Dword)
        public uint m_dwPKTick = 0;
        /// <summary>
        /// 魔血一套
        /// </summary>
        public int m_nMoXieSuite = 0;
        /// <summary>
        /// 虹魔一套
        /// </summary>
        public int m_nHongMoSuite = 0;
        /// <summary>
        /// 人物经络
        /// </summary>
        public TBatterPulse[] m_HumPulses = new TBatterPulse[4];
        public double m_db3B0 = 0;
        /// <summary>
        /// 中毒处理间隔时间
        /// </summary>
        public uint m_dwPoisoningTick = 0;
        /// <summary>
        /// 减PK值时间
        /// </summary>
        public uint m_dwDecPkPointTick = 0;
        /// <summary>
        /// 照明物品使用间隔
        /// </summary>
        public uint m_DecLightItemDrugTick = 0;
        public uint m_dwVerifyTick = 0;
        public uint m_dwCheckRoyaltyTick = 0;
        public uint m_dwDecHungerPointTick = 0;
        public uint m_dwHPMPTick = 0;
        /// <summary>
        /// 消息列表
        /// </summary>
        public IList<IntPtr> m_MsgList = null;
        /// <summary>
        /// 可见的人物列表
        /// </summary>
        public IList<TBaseObject> m_VisibleHumanList = null;
        /// <summary>
        /// 可见的物品列表
        /// </summary>
        public IList<TVisibleMapItem> m_VisibleItems = null;
        public IList<TVisibleMapEvent> m_VisibleEvents = null;
        /// <summary>
        /// 发送刷新消息的间隔
        /// </summary>
        public uint m_SendRefMsgTick = 0;
        /// <summary>
        /// 是否在开行会战
        /// </summary>
        public bool m_boInFreePKArea = false;
        /// <summary>
        /// 跑步间隔
        /// </summary>
        public uint dwTick3F4 = 0;
        /// <summary>
        /// 攻击间隔
        /// </summary>
        public uint m_dwHitTick = 0;
        /// <summary>
        /// 走路间隔
        /// </summary>
        public uint m_dwWalkTick = 0;
        public uint m_dwSearchEnemyTick = 0;
        /// <summary>
        /// 名字颜色改变
        /// </summary>
        public bool m_boNameColorChanged = false;
        /// <summary>
        /// 是否在可视范围内有人物,及宝宝
        /// </summary>
        public bool m_boIsVisibleActive = false;
        public sbyte m_nProcessRunCount = 0;
        /// <summary>
        /// 可见角色列表
        /// </summary>
        public IList<TVisibleBaseObject> m_VisibleActors = null;
        /// <summary>
        /// 背包列表
        /// </summary>
        public IList<TUserItem> m_ItemList = null;
        /// <summary>
        /// 技能表
        /// </summary>
        public IList<TUserMagic> m_MagicList = null;
        /// <summary>
        /// 装备栏物品
        /// </summary>
        public TUserItem[] m_UseItems = new TUserItem[14];
        public IList<TMonSayMsg> m_SayMsgList = null;
        /// <summary>
        /// 走路速度
        /// </summary>
        public int m_nWalkSpeed = 0;
        /// <summary>
        /// 行走步伐
        /// </summary>
        public int m_nWalkStep = 0;
        public int m_nWalkCount = 0;
        public uint m_dwWalkWait = 0;
        public uint m_dwWalkWaitTick = 0;
        /// <summary>
        /// 步行等待锁定
        /// </summary>
        public bool m_boWalkWaitLocked = false;
        /// <summary>
        /// 下个攻击时间
        /// </summary>
        public uint m_nNextHitTime = 0;
        /// <summary>
        /// 技能数组（0：普通技能 1：英雄技能 2：内功技能）
        /// </summary>
        public TUserMagic[][] m_MagicArr = null;
        // 攻杀是否可用
        public bool m_boPowerHit = false;
        // 刺杀剑法是否可用
        public bool m_boUseThrusting = false;
        // 半月弯刀是否可用
        public bool m_boUseHalfMoon = false;
        // 烈火剑法是否可用
        public bool m_boFireHitSkill = false;
        // 逐日剑法是否可用
        public bool m_boDailySkill = false;
        // 抱月弯刀是否可用
        public bool m_boCrsHitkill = false;
        // 开天斩是否可用
        public bool m_bo42kill = false;
        // 开天斩重轻击 初始为0,1轻,2重
        public byte m_n42kill = 0;
        // 龙影剑法是否可用
        public bool m_bo43kill = false;
        // 破魂斩是否可用
        public bool m_bo60kill = false;
        // 四级刺杀剑法可以使用
        public bool m_bo89Kill = false;
        // 圆月弯刀是否可用
        public bool m_bo90Kill = false;
        /// <summary>
        /// 正在使用连击
        /// </summary>
        public bool m_boUseBatter = false;
        /// <summary>
        /// 当前使用的连击技能
        /// </summary>
        public int m_nBatter = 0;
        // 连击次序
        public UInt16[] m_nBatterOrder = new UInt16[3];
        // 临时连击次序  产生随机 等
        public UInt16[] bOrder = new UInt16[3];
        // 暴击几率表
        public TStormsRate[] m_HumStormsRate = new TStormsRate[5];
        // 打通经络需要内功等级表
        public byte[] m_PulseNeedLev = new byte[20];
        // 连击单个技能使用完毕
        public bool m_boBatterFinally = false;
        public int m_nBatterX = 0;
        public int m_nBatterY = 0;
        public byte m_nBatterDir = 0;
        // 使用连击时候的目标
        public TBaseObject m_nBatterTarget = null;
        // 当前使用连击的技能ID
        public int m_nCurrBatterMagicID = 0;
        // 连击使用的间隔
        public uint m_nBatterUseTick = 0;
        public uint m_nBatterSpellTick = 0;
        // 倚天劈地是否可用
        public bool m_boYTPDHitSkill = false;
        // 血魄一击是否可用
        public bool m_boXPYJHitSkill = false;
        // 烈火的间隔
        public uint m_dwLatestFireHitTick = 0;
        // 倚天劈地召唤间隔
        public uint m_dwLatestYTPDHitTick = 0;
        // 血魄一击使用间隔
        public uint m_dwLatestXPYJHittick = 0;
        // 连击技使用间隔
        public uint m_dwLatestBatterHitTick = 0;
        // 逐日剑法的间隔 
        public uint m_dwLatestDailyTick = 0;
        // 开天斩的间隔 
        public uint m_dwLatest42Tick = 0;
        // 龙影剑法间隔 
        public uint m_dwLatest43Tick = 0;
        // 分身术的间隔 
        public uint m_dwLatest46Tick = 0;
        /// <summary>
        /// 是否刷新在地图上信息
        /// </summary>
        public bool m_boDenyRefStatus = false;
        // 是否增加地图计数(人物或怪物数量) T-不需要再计数,F-需要计数
        public bool m_boAddToMaped = false;
        /// <summary>
        /// 是否从地图中删除计数
        /// </summary>
        public bool m_boDelFormMaped = false;
        /// <summary>
        /// 是否自动变色
        /// </summary>
        public bool m_boAutoChangeColor = false;
        /// <summary>
        /// 自动变色间隔
        /// </summary>
        public uint m_dwAutoChangeColorTick = 0;
        /// <summary>
        /// 自动改变的索引
        /// </summary>
        public int m_nAutoChangeIdx = 0;
        /// <summary>
        /// 变色的类型
        /// </summary>
        public int m_nChangeColorType = 0;
        /// <summary>
        /// 是否自定义名字颜色
        /// </summary>
        public bool m_boSetNameColor = false;
        /// <summary>
        /// 是否已经发送显示连击图标
        /// </summary>
        public bool m_boSendShowBatterIcon = false;
        /// <summary>
        /// 是否可以使用连击(有没有这个技能)
        /// </summary>
        public bool m_boCanUseBatter = false;
        /// <summary>
        /// 固定颜色
        /// </summary>
        public bool m_boFixColor = false;
        /// <summary>
        /// 固定颜色的索引
        /// </summary>
        public int m_nFixColorIdx = 0;
        public int m_nFixStatus = 0;
        /// <summary>
        /// 快速麻痹，受攻击后麻痹立即消失
        /// </summary>
        public bool m_boFastParalysis = false;
        /// <summary>
        /// 必杀装备 死亡掉装备几率
        /// </summary>
        public bool m_DropUseItemPointer = false;
        /// <summary>
        /// 程序通信结构
        /// </summary>
        public TDefaultMessage m_DefMsg;
        /// <summary>
        /// 复制人辈分等级,显示名字用到
        /// </summary>
        public int m_nCopyHumanLevel = 0;
        /// <summary>
        /// 增加检测人物站立不动时间
        /// </summary>
        public uint m_dwStationTick = 0;
        /// <summary>
        /// 退出状态 1为死亡
        /// </summary>
        public byte m_btLastOutStatus = 0;
        /// <summary>
        /// 累计经验,达到一定值,增加英雄的忠诚度   聚灵珠使用
        /// </summary>
        public int m_nWinExp = 0;
        /// <summary>
        /// 正在操作背包列表
        /// </summary>
        public bool m_boOperationItemList = false;
        /// <summary>
        /// 内功怪,打死可以增加内力值
        /// </summary>
        public bool m_boIsNGMonster = false;
        /// <summary>
        /// 是否机器人对象
        /// </summary>
        public bool m_boRobotObject = false;

        public  TBaseObject()
            : base()
        {
            m_ActorsId = HUtil32.Sequence();
            m_ObjType = TObjType.t_Play;
            m_boSendShowBatterIcon = false;
            m_boCanUseBatter = false;
            m_boUseBatter = false;
            m_dwLatestBatterHitTick = HUtil32.GetTickCount();
            m_BatterUseTick = HUtil32.GetTickCount();
            m_nBatterOrder[0] = 0;
            m_nBatterOrder[1] = 0;
            m_nBatterOrder[2] = 0;
            m_boBatterFinally = false; // 连击单个技能使用完毕
            m_nBatterX = 0;
            m_nBatterY = 0;
            m_nBatterDir = 0;
            m_nBatterTarget = null; // 使用连击时候的目标
            m_nCurrBatterMagicID = 0;
            m_nBatterUseTick = HUtil32.GetTickCount();// 连击使用的间隔
            m_nBatterSpellTick = HUtil32.GetTickCount();
            m_boGhost = false;
            m_dwGhostTick = 0;
            m_boDeath = false;
            m_dwDeathTick = 0;
            m_SendRefMsgTick = HUtil32.GetTickCount();
            m_btDirection = 4;
            m_btRaceServer = Grobal2.RC_ANIMAL;
            m_btRaceImg = 0;
            m_btHair = 0;
            m_btJob = 0;
            m_nGold = 0;
            m_wAppr = 0;
            bo2B9 = true;
            m_nViewRange = 5;
            m_sHomeMap = "0";
            m_btPermission = 0;
            m_nLight = 0;
            m_btNameColor = 255;
            m_nHitPlus = 0;
            m_nHitDouble = 0;
            m_dBodyLuck = 0;
            m_boRecallSuite = false;
            bo245 = false;
            bo2BA = false;
            m_boAbilSeeHealGauge = false;
            m_boPowerHit = false;
            m_boUseThrusting = false;
            m_boUseHalfMoon = false;
            m_boFireHitSkill = false;
            m_boYTPDHitSkill = false; // 倚天劈地是否可用 
            m_boXPYJHitSkill = false; // 血魄一击是否可用 
            m_boDailySkill = false;// 逐日剑法是否可用 
            m_bo42kill = false;// 开天斩是否可用 
            m_bo43kill = false;// 龙影剑法是否可用  
            m_bo89Kill = false; // 四级刺杀
            m_bo90Kill = false;// 圆月弯刀
            m_n42kill = 0;// 开天斩轻击初始化 1--为轻 2--为重
            m_btHitPoint = 5;
            m_btSpeedPoint = 15;
            m_nHitSpeed = 0;
            m_btLifeAttrib = 0;
            m_btAntiPoison = 0;
            m_nPoisonRecover = 0;
            m_nHealthRecover = 0;
            m_nSpellRecover = 0;
            m_nAntiMagic = 0;
            m_nLuck = 0;
            m_nIncSpell = 0;
            m_nIncHealth = 0;
            m_nIncHealing = 0;
            m_nPerHealth = 5;
            m_nPerHealing = 5;
            m_nPerSpell = 5;
            m_dwIncHealthSpellTick = HUtil32.GetTickCount();
            m_btGreenPoisoningPoint = 0;
            m_nFightZoneDieCount = 0;
            m_nGoldMax = M2Share.g_Config.nHumanMaxGold;//人物携带游戏币最大数量
            m_nCharStatus = 0;
            m_nCharStatusEx = 0;
            btB2 = 0;
            m_btAttatckMode = 0;
            m_boInFreePKArea = false;
            m_boGuildWarArea = false;
            bo2B0 = false;
            m_boSuperMan = false;
            m_boButchSkeleton = false; // 正在被挖尸体
            m_boSkeleton = false;
            bo2BF = false;
            m_boHolySeize = false;
            m_boCrazyMode = false;
            m_boShowHP = false;
            bo2F0 = false;
            m_boAnimal = false;
            m_boNoItem = false;
            m_nBodyLeathery = 50;
            m_boFixedHideMode = false;
            m_boStickMode = false;
            m_boNoAttackMode = false;
            bo2C1 = false;
            m_boPKFlag = false;
            m_nMoXieSuite = 0;
            m_nHongMoSuite = 0;
            m_db3B0 = 0;
            m_AddAbil = new TAddAbility();
            m_MsgList = new List<IntPtr>();
            m_VisibleHumanList = new List<TBaseObject>();
            m_VisibleActors = new List<TVisibleBaseObject>();
            m_VisibleItems = new List<TVisibleMapItem>();
            m_VisibleEvents = new List<TVisibleMapEvent>();
            m_ItemList = new List<TUserItem>();
            m_MagicList = new List<TUserMagic>();
            m_boIsVisibleActive = false;
            m_nProcessRunCount = 0;
            m_Castle = null;
            m_Master = null;
            n294 = 0;
            m_btSlaveExpLevel = 0;
            m_boSetNameColor = false;// 是否自定义名字颜色
            m_SlaveList = new List<TBaseObject>();
            m_WAbil = new TAbility();
            m_Abil = new TAbility();
            // FillChar(m_QuestUnitOpen, SizeOf(TQuestUnit), #0);
            // FillChar(m_QuestUnit, SizeOf(TQuestUnit), #0);
            m_Abil.Level = 1;
            m_Abil.AC = 0;
            m_Abil.MAC = 0;
            m_Abil.DC = HUtil32.MakeLong(1, 4);
            m_Abil.MC = HUtil32.MakeLong(1, 2);
            m_Abil.SC = HUtil32.MakeLong(1, 2);
            m_Abil.HP = 15;
            m_Abil.MP = 15;
            m_Abil.MaxHP = 15;
            m_Abil.MaxMP = 15;
            m_Abil.Exp = 0;
            m_Abil.MaxExp = 50;
            m_Abil.Weight = 0;
            m_Abil.MaxWeight = 100;
            m_boWantRefMsg = false;
            m_MyGuild = null;
            m_nGuildRankNo = 0;
            m_sGuildRankName = "";
            m_boMission = false;
            m_boHideMode = false;
            m_boStoneMode = false;
            m_boCoolEye = false;
            m_boUserUnLockDurg = false;
            m_boTransparent = false;
            m_boAdminMode = false;
            m_boObMode = false;
            m_dwRunTick = Convert.ToUInt32(HUtil32.GetTickCount() + ((uint)HUtil32.Random(1500)));
            m_nRunTime = 250;
            m_dwSearchTime = Convert.ToUInt32(HUtil32.Random(2000) + 2000);
            m_dwSearchTick = HUtil32.GetTickCount();
            m_dwDecPkPointTick = HUtil32.GetTickCount();
            m_DecLightItemDrugTick = HUtil32.GetTickCount();
            m_dwPoisoningTick = HUtil32.GetTickCount();
            m_dwVerifyTick = HUtil32.GetTickCount();
            m_dwCheckRoyaltyTick = HUtil32.GetTickCount();
            m_dwDecHungerPointTick = HUtil32.GetTickCount();
            m_dwHPMPTick = HUtil32.GetTickCount();
            m_dwTeleportTick = 0;
            m_dwProbeTick = 0;
            m_dwMapMoveTick = HUtil32.GetTickCount();
            m_dwMasterTick = 0;
            m_nWalkSpeed = 1400;
            m_nNextHitTime = 2000;
            m_nWalkCount = 0;
            m_dwWalkWaitTick = HUtil32.GetTickCount();
            m_boWalkWaitLocked = false;
            m_nHealthTick = 0;
            m_nSpellTick = 0;
            m_TargetCret = null;
            m_LastHiter = null;
            m_ExpHitter = null;
            m_SayMsgList = null;
            m_boDenyRefStatus = false;
            m_btHorseType = 0;
            m_btDressEffType = 0;
            m_dwPKDieLostExp = 0;
            m_nPKDieLostLevel = 0;
            m_boAddToMaped = false;//原来为true 地图是否计数
            m_boAutoChangeColor = false;
            m_dwAutoChangeColorTick = HUtil32.GetTickCount();
            m_nAutoChangeIdx = 0;
            m_nChangeColorType = -1;// 是否变色
            m_boFixColor = false;
            m_nFixColorIdx = 0;
            m_nFixStatus = -1;
            m_boFastParalysis = false;
            m_nCopyHumanLevel = 0;// 复制人状态
            m_dwStationTick = HUtil32.GetTickCount();// 站的时间
            m_btLastOutStatus = 0;
            m_boProtectionDefence = false;// 是否使用护体神盾 
            m_btMagBubbleDefenceLevel = 0;// 魔法盾等级 
            m_boProtectionDefenceLevel = 0;// 护体神盾等级 
            m_boOperationItemList = false;// 正在操作背包列表 
            m_boIsNGMonster = false;// 内功怪,打死可以增加内力值 
            m_boRobotObject = false;
            m_MagicArr = new TUserMagic[2][];
            for (int i = 0; i < m_MagicArr.Length; i++)
            {
                m_MagicArr[i] = new TUserMagic[255];
            }
            M2Share.ActorsSystem.Add(m_ActorsId, this);
        }

        unsafe ~TBaseObject()
        {
            TSendMessage* SendMessage;
            int nCheckCode;
            const string sExceptionMsg = "[异常] TBaseObject::Destroy Code: %d CharName: %s";
            nCheckCode = 0;
            try
            {
                nCheckCode = 1;
                if (m_MsgList != null)
                {
                    if (m_MsgList.Count > 0)
                    {
                        for (var i = 0; i < m_MsgList.Count; i++)
                        {
                            nCheckCode = 2;
                            SendMessage = (TSendMessage*)m_MsgList[i];
                            if (SendMessage != null)
                            {
                                if ((SendMessage->wIdent == Grobal2.RM_SENDDELITEMLIST) && (SendMessage->nParam1 != 0))
                                {
                                    nCheckCode = 3;
                                    if (SendMessage->nParam1 != 0)
                                    {
                                        Marshal.FreeHGlobal((IntPtr)SendMessage->nParam1);
                                        nCheckCode = 4;
                                    }
                                }
                                if ((SendMessage->wIdent == Grobal2.RM_10401) && (SendMessage->nParam1 != 0))
                                {
                                    nCheckCode = 5;
                                    Marshal.FreeHGlobal((IntPtr)SendMessage->nParam1);
                                }
                                nCheckCode = 6;
                                if (SendMessage->Buff != null && SendMessage->Buff.ToInt32() != 0)
                                {
                                    nCheckCode = 7;
                                    Marshal.FreeHGlobal(SendMessage->Buff);
                                }
                                Marshal.FreeHGlobal((IntPtr)SendMessage);
                                nCheckCode = 8;
                            }
                        }
                    }
                    nCheckCode = 9;
                    if (m_MsgList != null)
                    {
                        m_MsgList = null;
                    }
                }
                nCheckCode = 10;
                try
                {
                    if (m_VisibleHumanList != null)
                    {
                        m_VisibleHumanList = null;
                    }
                }
                catch
                {
                }
                nCheckCode = 120;
                if (m_VisibleActors != null)
                {
                    nCheckCode = 121;
                    if (m_VisibleActors.Count > 0)
                    {
                        nCheckCode = 122;
                        for (var i = 0; i < m_VisibleActors.Count; i++)
                        {
                            try
                            {
                                if (m_VisibleActors[i] != null)
                                {
                                    Dispose(m_VisibleActors[i]);
                                }
                            }
                            catch
                            {
                            }
                        }
                    }
                    nCheckCode = 13;
                    try
                    {
                        if (m_VisibleActors != null)
                        {
                            m_VisibleActors = null;
                        }
                    }
                    catch
                    {
                    }
                }
                nCheckCode = 14;
                if (m_VisibleItems != null)
                {
                    if (m_VisibleItems.Count > 0)
                    {
                        for (var i = 0; i < m_VisibleItems.Count; i++)
                        {
                            try
                            {
                                if (m_VisibleItems[i] != null)
                                {
                                    Dispose(m_VisibleItems[i]);
                                }
                            }
                            catch
                            {
                            }
                        }
                    }
                    nCheckCode = 15;
                    m_VisibleItems = null;
                }
                nCheckCode = 16;
                if (m_VisibleEvents != null)
                {
                    if (m_VisibleEvents.Count > 0)
                    {
                        nCheckCode = 17;
                        for (var i = 0; i < m_VisibleEvents.Count; i++)
                        {
                            nCheckCode = 18;
                            try
                            {
                                if (m_VisibleEvents[i] != null)
                                {
                                    Dispose(m_VisibleEvents[i]);
                                }
                            }
                            finally { }
                        }
                    }
                    nCheckCode = 19;
                    m_VisibleEvents = null;
                }
                nCheckCode = 20;
                //if (m_MagicList != null)
                //{
                //    if (m_MagicList.Count > 0)
                //    {
                //        for (var i = 0; i < m_MagicList.Count; i++)
                //        {
                //            try
                //            {
                //                if (m_MagicList[i] != null)
                //                {
                //                    Marshal.FreeHGlobal((IntPtr)m_MagicList[i]);
                //                }
                //            }
                //            finally { }
                //        }
                //    }
                //    m_MagicList = null;
                //}
                nCheckCode = 21;
                if (m_SlaveList != null)
                {
                    m_SlaveList = null;
                }
                nCheckCode = 17;
                if (m_ItemList != null)
                {
                    m_boOperationItemList = true;// 防止同时操作背包列表时保存
                    for (var i = m_ItemList.Count - 1; i >= 0; i--)
                    {
                        if (m_ItemList.Count <= 0)
                        {
                            break;
                        }
                        nCheckCode = 24;
                        try
                        {
                            if ((TUserItem)m_ItemList[i] != null)
                            {
                                //Marshal.FreeHGlobal(m_ItemList[i]);
                            }
                        }
                        catch
                        {
                            m_ItemList.RemoveAt(i);
                            M2Share.MainOutMessage(string.Format(sExceptionMsg, nCheckCode, m_sCharName));
                            if (m_ItemList.Count > 0)
                            {
                                continue;
                            }
                        }
                    }
                    nCheckCode = 18;
                    m_ItemList = null;
                    m_boOperationItemList = false;// 防止同时操作背包列表时保存
                }
            }
            catch
            {
                M2Share.MainOutMessage(string.Format(sExceptionMsg, nCheckCode, m_sCharName));
            }
        }
    }
}
